package com.syzg.base.aduit.service.impl;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.syzg.base.aduit.dao.AuditDAO;
import com.syzg.base.aduit.model.Audit;
import com.syzg.base.aduit.service.AuditService;
import com.syzg.common.service.impl.BaseServiceImpl;
import com.syzg.common.util.SearchMap;
import com.syzg.core.exception.ServiceException;
import com.syzg.core.page.PageResult;

@Service("auditService")
public class AuditServiceImpl extends BaseServiceImpl<Audit> implements AuditService {

	private AuditDAO auditDAO;

	@Resource
	public void setAuditDAO(AuditDAO auditDAO) {
		this.setDAO(auditDAO);
		this.auditDAO = auditDAO;
	}

	public PageResult listAudit(int pageNo, int pageSize, SearchMap searchMap) throws ServiceException {
		return auditDAO.findObjectsForPage(pageNo, pageSize, searchMap);
	}
	
	public void saveAuditLog(Audit audit){
		auditDAO.create(audit);
	}
}
